<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="__PUBLIC__/favicon.ico" >
<LINK rel="Shortcut Icon" href="__PUBLIC__/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="__PUBLIC__/static/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/static/h-ui.admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/lib/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/css/style.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/laydate/laydate.js"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/jquery.editable-select.min.css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>建档</title>
</head>
<body>

<form class="form form-horizontal" action="" id="form-consump-alert" method="post">
<table class="table table-border table-bordered table-bg jd" style="width:95%; margin:20px auto;">
  <!--建档-->

  <input name="consume_id" value="{$consumelist.consume_id}" type="hidden" />
  <if condition="$user_auth['roleid'] eq '8'">
  <tr>
    <td width="120">贷款人信息</td>
    <td>
    <ul>

    <li> 贷款人姓名：{$consumelist.client_name}</li>
    <li>身份证号：{$consumelist.card}</li>
    <li>建档时间：<notempty name='consumelist.creat_time'>{$consumelist.creat_time|date='Y-m-d',###}</notempty></li>
    <li>手机号码：{$consumelist.phone}</li>
    <li>固定电话：{$consumelist.tel}</li>
    <li>工作单位：{$consumelist.work}</li>
    <li>单位电话：{$consumelist.work_tel}</li>
    </ul>
    </td>
  </tr>
  <tr>
    <td>贷款信息</td>
    <td>
    <ul>
    <li>贷款金额：{$consumelist.loan_amount}万元</li>
    <li>贷款年限：{$consumelist.loan_year}年</li>
    <li>贷款银行（支行）：{$consumelist.bank_id|getBankname}</li>
    <li>推荐人：{$consumelist.referrer_id|getUsername}</li>
    </ul>
     <ul>
    <li>品种：<if condition="$consumelist['loan_type'] eq 1">信用贷</if>
    <if condition="$consumelist['loan_type'] eq 2">消费贷</if>
    <if condition="$consumelist['loan_type'] eq 3">企业贷</if>
    </li>
   </ul>
     <ul>
    <li>备注：{$consumelist.remark}</li>
    </ul>
    </td>
  </tr>
  <tr>
    <td>房屋信息</td>
    <td>
    <ul>
    <li>地址：{$consumelist.house_addresss}</li>
    </ul>
    <ul>
    <li>抵押日期：<notempty name='consumelist.mortgage_time'>{$consumelist.mortgage_time|date='Y-m-d',###}</notempty></li>

    <li>下款日期：<notempty name='consumelist.credit_time'>{$consumelist.credit_time|date='Y-m-d',###}</notempty></li>
    </ul>
    </td>
  </tr>
  <else />
  <tr>
    <td width="120">贷款人信息</td>
    <td>
    <ul>
        <input name="consume_id" value="{$consumelist.consume_id}" type="hidden" />
    <li> 贷款人姓名<input type="text" name="client_name" id="client_name" value="{$consumelist.client_name}" class="input-text kk" style=" width:120px"></li>
    <li>身份证号<input type="text" name="card" id="card"  value="{$consumelist.card}" class="input-text kk" style=" width:180px;"></li>
    <li>建档时间<input class="input-text kk" onClick="laydate()" name="create_time" id="create_time"  value="<notempty name='consumelist.creat_time'>{$consumelist.creat_time|date='Y-m-d',###}</notempty>" style=" width:100px"></li>
    <li>手机号码<input type="text" name="phone" id="phone"  value="{$consumelist.phone}" class="input-text kk" style=" width:120px"></li>
    <li>固定电话<input type="text" name="tel" id="tel"   value="{$consumelist.tel}" class="input-text kk" style=" width:120px"></li>
    <li>工作单位<input type="text" name="work" id="work"  value="{$consumelist.work}" class="input-text kk" style=" width:240px;"></li>
    <li>单位电话<input type="text" name="work_tel" id="work_tel"  value="{$consumelist.work_tel}" class="input-text kk" style=" width:120px"></li>
    </ul>
    </td>
  </tr>
  <tr>
    <td>贷款信息</td>
    <td>
    <ul>
    <li>贷款金额<input type="text" name="loan_amount" id="loan_amount"  value="{$consumelist.loan_amount}" class="input-text kk" style=" width:100px">万元</li>
    <li>贷款年限<input type="text" name="loan_year" id="loan_year"  value="{$consumelist.loan_year}" class="input-text kk" style=" width:100px">年</li>
    <li>贷款银行（总行）
			<select name="bank_id" class="select2 kk bank-zong">
				<option >请选择总行</option>
	      <volist name="banks" id="banks" >
	      <option value="{$banks.bank_id}">{$banks.bank_name}</option>
	      </volist>
    	</select>
		</li>
		<li>贷款银行（支行）
			<select name="part_bank_id" class="select2 kk bank-zhi">
	      <option>请先选择总行</option>
    	</select>
		</li>
     <li>推荐人
         <select name="referrer_id" id="editable-select"  style=" width:200px;display:inline"  class="form-control select2 kk">
             <option>请选择</option>
             <volist name="users" id="u">
             <option value="{$u.user_id}" <if condition="$u['user_id'] eq $consumelist['referrer_id']">selected</if> >{$u.user_name}</option>
             </volist>
         </select>
     </li>
    </ul>
     <ul>
    <li>品种
    <input name="loan_type" type="radio" value="1" <if condition="$consumelist['loan_type'] eq 1">checked</if> class="kk">信用贷
    <input name="loan_type" type="radio" value="2" <if condition="$consumelist['loan_type'] eq 2">checked</if> class="kk">消费贷
    <input name="loan_type" type="radio" value="3" <if condition="$consumelist['loan_type'] eq 3">checked</if> class="kk">企业贷
    </li>
   </ul>
   <ul>
		 <li>送审时间：<input type="text" name="send_time"  onClick="laydate()" value="{$consumelist.send_time|turnTime}" class="input-text kk" style=" width:200px"></li>
		 <li>实际审核完成时间：<input type="text" name="finish_time"  onClick="laydate()" value="{$consumelist.finish_time|turnTime}" class="input-text kk" style=" width:200px"></li>
	 </ul>
     <ul>
    <li><textarea name="remark" cols="" rows="" class="textarea"  placeholder="请填写备注" style="width:600px;">{$consumelist.remark}</textarea></li>
    </ul>
    </td>
  </tr>
  <tr>
    <td>房屋信息</td>
    <td>
    <ul>
    <li>地址<input type="text" name="house_addresss" id="house_addresss"  value="{$consumelist.house_addresss}" class="input-text kk" style=" width:400px"></li>
    </ul>
    <ul>
    <li>抵押日期<input class="input-text kk" onClick="laydate()" name="mortgage_time" id="mortgage_time" value="<notempty name='consumelist.mortgage_time'>{$consumelist.mortgage_time|date='Y-m-d',###}</notempty>" style=" width:100px"></li>
    <li>下款日期<input class="input-text kk" onClick="laydate()" name="credit_time" id="credit_time" value="<notempty name='consumelist.credit_time'>{$consumelist.credit_time|date='Y-m-d',###}</notempty>" style=" width:100px"></li>
    </ul>
    </td>
  </tr>
  </if>

  <?php
  if(strstr($user_auth['level'],"34")){
  ?>
  <tr>
  <td width="120">收费</td>
  <td>
  <ul><li>收费日期<input class="input-text kk" onClick="laydate()" name="charge_time" id="charge_time" value="<notempty name='consumelist.charge_time'>{$consumelist.charge_time|date='Y-m-d',###}</notempty>" style=" width:100px"></li></ul>
  </td>
  </tr>
  <?php
  }
  else{
  ?>
  <tr>
  <td width="120">收费</td>
  <td>
  <ul><li>收费日期：<if condition="$consumelist.charge_time neq ''">{$consumelist.charge_time|date="Y-m-d",###}</if></li></ul>
  </td>
  </tr>
  <?php
      }
  ?>

  <tr>
  <td colspan="2" style="text-align:center"><input type="submit" value="保存"  class="btn btn-danger radius"></td>
  </tr>

 </table>
</form>




<script type="text/javascript" src="__PUBLIC__/lib/jquery/1.9.1/jquery.min.js"></script>

<script type="text/javascript" src="__PUBLIC__/lib/layer/2.1/layer.js"></script>

<script type="text/javascript" src="__PUBLIC__/css/jquery.editable-select.min.js"></script>
<script type="text/javascript">
$('#editable-select').editableSelect({
	effects: 'slide'
});
$('#html').editableSelect();
</script>
<script type="text/javascript">
$('.bank-zong').change(function(){
    var id = $('select[name="bank_id"]').val();
    $.ajax({
        type:'post',
        url:"{:U('Index/zhi')}",
        data:{id:id},
        dataType:'json',
        success:function(json){
            console.log(json);
            $('.bank-zhi').empty();
            $('.bank-zhi').append('<option value="">请选择支行</option>')
            var len=json.length;
            for(i = 0;i <= len;i++){
                $('.bank-zhi').append('<option value='+json[i]['bank_id']+'>'+json[i]['bank_name']+'</option>')
            }
        }
    })
})

var index = parent.layer.getFrameIndex(window.name)
$("#form-consump-alert").submit(function(){
$(".radius").attr('type','button');
        $.ajax({
          url:'{:U('Consump/alertconsumption')}',
          type:'post',
          data:$('#form-consump-alert').serialize(),
          dataType:'json',
          success:function(data){
            if(data.ResultCode == '200'){
              layer.msg(data.ResultMessage,{time:1000},function(){
                  parent.window.location.reload()
                  parent.layer.close(index);
              });
            }
            else if(data.ResultCode == '500'){
                layer.msg(data.ResultMessage,{time:1000},function(){

                })
            }
          }
        })
        return false;
	});


</script>
</body>
</html>
